package com.scoring.system.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.scoring.system.mapper.CourseMapper;
import com.scoring.system.pojo.Course;
import com.scoring.system.service.CourseService;
@Service("courseService")
public class CourseServiceImpl implements CourseService {
	
	@Resource
	private CourseMapper courseDao;

	@Override
	public int softDelete(int id) {
		return courseDao.softDelete(id);
	}

	@Override
	public int saveCourse(Course record) {
		return courseDao.insert(record);
	}

	@Override
	public Course getCourseById(int id) {
		return courseDao.selectByPrimaryKey(id);
	}

	@Override
	public Course getCourseByName(String name) {
		return courseDao.selectByName(name);
	}

	@Override
	public List<Course> listCourseByColleageId(int colleageId) {
		return courseDao.listCourseByColleageId(colleageId);
	}

	@Override
	public int updateCourse(Course record) {
		return courseDao.updateByPrimaryKey(record);
	}

	@Override
	public Course getCourseBycode(String code) {
		return courseDao.selectByCode(code);
	}

}
